<?php $this->_extends('_layouts/main_layout'); ?>
<?php $this->_block('title'); ?>
  Publisher Dashboard
<?php $this->_endblock(); ?>

<?php $this->_block('contents'); ?>
		<div id="content" class="box">
			<h1>Publisher Dashboard</h1>
			<div id="select">
				<select name="campaign_filter" id="campaign_filter">
					<option value="a">show all campaigns</option>
					<option value="3">show all but deleted campaigns</option>
					<option value="1">show only active</option>
				</select>
				<select name="time_filter" id="time_filter">
					<option value="today">Today</option>
					<option value="yesterday">Yesterday</option>
					<option value="last7days">Last 7 days</option>
					<option value="monthtodate">Month to Date</option>
					<option value="lastmonth">Last Month</option>
					<option value="all">Lifetime</option>
				</select>
			</div>
			<table class="full-size">
				<tbody>
					<tr>
						<th>Campaign</th>
						<th>Status</th>
						<th>Created</th>
						<th>Impression</th>
						<th>Click</th>
						<th>CTR</th>
						<th>Conversion</th>
						<th>CR</th>
						<th>eCPA</th>
					</tr>
					<?php
						if(!empty($campaigns)):
							foreach ($campaigns as $campaign):
					?>
						<tr>
							<td><?php echo $campaign['name'];?></td>
							<td><?php echo $campaign['status'];?></td>
							<td><?php echo date('m/d/Y', $campaign['created']);?></td>
							<td><?php echo $campaign['impression'];?></td>
							<td><?php echo $campaign['click'];?></td>
							<td><?php echo $campaign['ctr'];?></td>
							<td><?php echo $campaign['conversion'];?></td>
							<td><?php echo $campaign['cr'];?></td>
							<td><?php echo $campaign['ecpa'];?></td>
						<tr>
					<?php 
							endforeach;	
						endif;		
					?>
				</tbody>
			</table>
			<table class="table_sum">
				<tbody>
					<tr>
						<td>Average</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
					<tr>
						<td>Total</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
				</tbody>
			</table>
		</div>
<?php $this->_endblock(); ?>